import { Component } from '@angular/core';

import { NavController } from 'ionic-angular';

import { EmailListPage } from '../list/list.component';

import { EmailSendPage } from '../send/send.component';

@Component({
	selector: 'page-email-index',
	templateUrl: 'index.html'
})
export class EmailIndexPage {
	moa_page_name: any = "page-email-index";
  moa_page_explain: any = "邮件中心";

	menu = [{
		icon: "xyj.png",
		name: "写邮件",
		listType: null
	},
	{
		icon: "sjx.png",
		name: "收件箱",
		listType: "IMailInbox"
	},
	{
		icon: "cgx.png",
		name: "草稿箱",
		listType: "DraftBox"
	},
	{
		icon: "fajx.png",
		name: "发件箱",
		listType: "IMOutbox"
	},
	{
		icon: "feijx.png",
		name: "废件箱",
		listType: "WasteBox"
	},
	{
		icon: "dbyj.png",
		name: "待办邮件",
		listType: "IMailTask"
	},
	{
		icon: "zyyj.png",
		name: "重要邮件",
		listType: "IMailImp"
	},
	{
		icon: "lsyj.png",
		name: "历史邮件",
		listType: "IMailHIS"
	}]
	constructor(
		public navCtrl: NavController
	) { }
	openPage(item) {
		// 如果是列表，跳转到列表页面
		if (item.listType) {
			this.navCtrl.push(EmailListPage, {
				listType: item.listType
			});
		} else {
			this.navCtrl.push(EmailSendPage);
			// 如果不是跳转到写邮件页面
		}
	}
}

